Added EquipEffect.java to replace Effect.java
[PersonaRL.git] / Coding Style.txt
blob82fb17eef17cd2403439d143cacd863a5ff07860
1 FUNCTIONS
2 - Functions names in CamelCase with first letter not capitalized.
3 - Opening curly bracket '{' for a function starts on the next line.
5 VARIABLES
6 - Variable names in CamelCase with first letter not capitalized.
7 - Own members of classes should always be referenced using "this.".
8 - Variables that are declared below one another should have their type, name or reference operator, and assignment
9   operator aligned by spaces.
10 - Declare variables upon first usage. (?)
11 - Declare iterators in their loop.
12 - Give variables meanigful names.
14 ENUMERATIONS
15 - Enumeration names also use CamelCase.
16 - Enumerators are all caps with "_" between the words.
17 - Numbers that store single or uncorrelated data are static consts. Those may use the naming conventions of enums.
19 CONTROL FLOW
20 - Put a space before the parentheses in if, switch, for and while statements.
21 - Use curly braces and put the contained statements on their own lines (e.g., don't put them directly after the if).
22 - Use curly braces and put the contained statements on their own lines (e.g.,
23   don't put them directly after the if). (?)
24 - Opening curly bracket { stays on the first line, closing curly bracket } gets a line to itself (except for the }
25   preceding an else, which should be on the same line as the else). (?)
26 - All fall throughs must be documented, using a FALL THROUGH comment.
28 CLASSES
29 - Classes names also use CamelCase. 
30 - Methods and members ought to be grouped logically.
31 - All those sorting rules sometimes conflict which one another. Please use common sense what increases legibility of
32   the code in such a case.
34 ...